
class BigInput
  def self.write(integration_parameters, bodies)
    big = ""
    
    #heredoc for the header of big.in
    big_header = <<OUTPUT
)O+_06 Big-body initial data  (WARNING: Do not delete this line!!)
) Lines beginning with `)' are ignored.
)---------------------------------------------------------------------
 style (Cartesian, Asteroidal, Cometary) = Ast
 epoch (in days) = %f
)---------------------------------------------------------------------
OUTPUT

    big_header = sprintf(big_header, integration_parameters.start_time)
    big << big_header

    #heredoc for each planet definition in big.in
    define_body = <<OUTPUT
 %s    m=%e
 %e %e 0.
  0. 0. 0.
  0. 0. 0.    
OUTPUT
		
		bodies.each do |body|
      current_body = sprintf(define_body, body.name, body.mass,
                             body.semi_major_axis, body.eccentricity)
      big << current_body
    end
    return big
  end
end
